<?php
/**
 * Created by PhpStorm.
 * User: dream
 * Date: 2017/8/21
 * Time: 16:40
 */
class Mood extends MY_Controller
{


    public function index()
    {
        $this->loadHelper("url");

        //查询数据库数据
        $this->loadModel("usermood");
        $base_url= web_url('mood/index') ;
        $offset = $this->uri->segment(4);
        $per_page = 5;
        $where = ["user_id"=>ADMIN_ID]; //查询条件
        $db_moods = $this->usermood->getWhere($where,$offset,$per_page,true);
        $view_data['moods'] = $db_moods;
        //分页  分配数据
        $count = $this->usermood->getRows(["user_id"=>ADMIN_ID]);
        $views = [FRONT."header",FRONT."mood/mood_index",FRONT."footer"];

        $this->_pagination($base_url,$count,$per_page,$views,$view_data);
    }



}